package t327.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import t327.mapper.*;
import t327.pojo.*;
import t327.pojo.views.SubmissionPaLnView;
import t327.service.iter.ITailorService;

import java.util.List;

@Service
@Transactional
public class TailorImpl implements ITailorService {
    @Autowired
    private TakeAwaySubmitMapper takeAwaySubmitMapper;
    @Autowired
    private MaterialsMapper materialsMapper;
    @Autowired
    private StyleNumberMapper styleNumberMapper;
    @Autowired
    private ProductDetailMapper productDetailMapper;
    @Autowired
    private SubmissionPaLnMapper submissionPaLnMapper;
    @Autowired
    private SubmissionMapper submissionMapper;
    @Autowired
    private HomePageRenderingMapper homePageRenderingMapper;
    @Override
    public int addTakeAwaySubmit(TakeAwaySubmit takeAwaySubmit) {
        return takeAwaySubmitMapper.addTakeAwaySubmit(takeAwaySubmit);
    }

    @Override
    public List<Materials> queryMaterials() {
        return materialsMapper.queryAll();
    }

    @Override
    public List<ProductDetail> getProductDetail() {
        return productDetailMapper.getProductDetail();
    }

    @Override
    public List<StyleNumber> queryStyleNumber() {
        return styleNumberMapper.queryAll();
    }

    @Override
    public List<SubmissionPaLnView> queryAll() {
        return submissionPaLnMapper.queryAll();
    }

    @Override
    public int delSubmission(Long id) {
        return submissionMapper.delSubmission(id);
    }

    @Override
    public int upSubmission(Long producedCount, Long id) {
        return submissionMapper.upSubmission(producedCount, id);
    }
    @Override
    public List<Submission> checkSewingProductionQuantity() {
        return homePageRenderingMapper.checkSewingProductionQuantity();
    }

}